<?php
class login extends CI_Controller{
    //put your code here

    public function  __construct() {
        parent::__construct();
        //parent::controller();
    }

    // Controller mặc định cho login
    public function index(){
        
        
		$this->load->view("login/admin_index.ctp");
    }
    public function checkin(){
        $admin_username = $this->input->post('ad_user');
		$admin_password = $this->input->post('ad_pass');
		if ($admin_username=="admin" && $admin_password=='admin'){
		  $user_ad = array('username'=>'admin',
                            'password'=>'admin');
		  $this->session->set_userdata($user_ad);
			redirect(base_url().'ncadm');
		}
        else{
            echo '<script>alert("Tài khoản hoặc mật khẩu không đúng!")</script>';
        }
        $this->load->view("login/admin_index.ctp");
    }

    
   

}
?>